<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib uri="http://www.openkoala.com/token" prefix="token" %>
<%@include file="../common/meta.jsp" %>
<form>
	<token:token></token:token>
	<div>
		<input type="text" name="name"  placeholder="" datatype="percent" errormsg="正则校验失败">
		<span class="Validform_checktip"></span>
	</div>
	<div>
		<input type="text" name="age" placeholder="" datatype="n1-2" errormsg="正则校验失败">
		<span class="Validform_checktip"></span>
	</div>
	<input type="button" id="btnSave" value="baocun">
</form>
<script>
var validform = $("form").ValidformCustom();

$("#btnSave").click(function(){
	console.log(validform.check());
	if(!validform.check()){
		return ;
	}
	var opt = {};
	var url = contextPath + "/platform/client.do";
	opt ={
		success:function(msg){
			BootstrapDialog.alert("保存成功");
			//skip("/pages/table/data.jsp");
		},
		formObj : $("form"),
		endpoint:"/Demo/saveDemo",
		failure :function(){
			BootstrapDialog.alert("保存失败");
		}
	};
	Ajax.submitForm(url, opt);
});
</script>